package com.example.kiratest.notify.POJO;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)
public class CardRequest {
    @JSONField(name = "cardTemplateId")
    private String cardTemplateId;

    @JSONField(name = "outTrackId")
    private String outTrackId ;

    @JSONField(name = "cardData")
    private CardData cardData = new CardData();

    @JSONField(name = "imGroupOpenSpaceModel")
    private ImGroupOpenSpaceModel imGroupOpenSpaceModel = new ImGroupOpenSpaceModel();

    @JSONField(name = "openSpaceId")
    private String openSpaceId;

    @JSONField(name = "imGroupOpenDeliverModel")
    private ImGroupOpenDeliverModel imGroupOpenDeliverModel = new ImGroupOpenDeliverModel();

    public CardRequest(String title, List<DingtalkColumnsItem> columns) {
        this.getCardData().getCardParamMap().setTitle(title);
        this.getCardData().getCardParamMap().getTableBean().setMeta(columns);
        this.getImGroupOpenSpaceModel().getLastMessageI18n().setZhCn(title);

    }

}

